home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / DeleteGroupInUseDlg.cpp < prev    next >
C/C++ Source or Header  |  2011-11-06  |  2KB  |  84 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2005 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. #include "stdafx.h"
  20. #include "FileZilla server.h"
  21. #include "DeleteGroupInUseDlg.h"
  22. #include ".\deletegroupinusedlg.h"
  23.  
  24. IMPLEMENT_DYNAMIC(CDeleteGroupInUseDlg, CDialog)
  25. CDeleteGroupInUseDlg::CDeleteGroupInUseDlg(CWnd* pParent /*=NULL*/)
  26.     : CDialog(CDeleteGroupInUseDlg::IDD, pParent)
  27.     , m_action(0)
  28. {
  29. }
  30.  
  31. CDeleteGroupInUseDlg::~CDeleteGroupInUseDlg()
  32. {
  33. }
  34.  
  35. void CDeleteGroupInUseDlg::DoDataExchange(CDataExchange* pDX)
  36. {
  37.     CDialog::DoDataExchange(pDX);
  38.     DDX_Control(pDX, IDC_DESC, m_Desc);
  39.     DDX_Control(pDX, IDC_NEWGROUPCOMBO, m_NewGroup);
  40.     DDX_Radio(pDX, IDC_RADIO1, m_action);
  41. }
  42.  
  43.  
  44. BEGIN_MESSAGE_MAP(CDeleteGroupInUseDlg, CDialog)
  45.     ON_BN_CLICKED(IDOK, OnOK)
  46. END_MESSAGE_MAP()
  47.  
  48. BOOL CDeleteGroupInUseDlg::OnInitDialog()
  49. {
  50.     CDialog::OnInitDialog();
  51.  
  52.     CString str;
  53.     m_Desc.GetWindowText(str);
  54.     CString str2;
  55.     str2.Format(str, m_groupName);
  56.     m_Desc.SetWindowText(str2);
  57.  
  58.     m_NewGroup.AddString(_T("-- None --"));
  59.     for (unsigned int i = 0; i < m_GroupsList->size(); i++)
  60.     {
  61.         CString name = (*m_GroupsList)[i].group;
  62.         if (name == m_groupName)
  63.             continue;
  64.         m_NewGroup.AddString(name);
  65.     }
  66.     m_NewGroup.SetCurSel(0);
  67.  
  68.     m_action = 0;
  69.  
  70.     UpdateData(false);
  71.  
  72.     return true;
  73. }
  74.  
  75. void CDeleteGroupInUseDlg::OnOK()
  76. {
  77.     UpdateData(true);
  78.     if (m_NewGroup.GetCurSel() > 0)
  79.         m_NewGroup.GetLBText(m_NewGroup.GetCurSel(), m_groupName);
  80.     else
  81.         m_groupName = _T("");
  82.     CDialog::OnOK();
  83. }
  84.